package com.homeinns.client.feignclient;

import com.homeinns.common.DecreaseStockInput;
import com.homeinns.common.ProductInfoOutput;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Component
@FeignClient(name = "lyx-product-server")
public interface ProductClient {

    @PostMapping(value = "/product/listForOrder",name = "查询商品信息")
    List<ProductInfoOutput> listForOrder(@RequestBody List<String> productInfos);

    @PostMapping(value = "/product/decreaseStock", name = "减少库存")
    void decreaseStock(@RequestBody List<DecreaseStockInput> decreaseStockInputs);

}
